﻿// <copyright file="VisibilityConverter.cs" company="Ucaya">
// </copyright>
// <author>Ucaya</author>

namespace Channel9Kinect.Core
{
    #region

    using System;
    using System.Globalization;
    using System.Windows;
    using System.Windows.Data;

    #endregion

    public class VisibilityConverter : IValueConverter
    {
        #region Public Methods

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var b = value as bool?;
            if (b != null)
            {
                return b.Value ? Visibility.Visible : Visibility.Collapsed;
            }
            if (value != null)
            {
                return Visibility.Visible;
            }
            return Visibility.Collapsed;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}